package com.shangze.test.base;

import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.shangze.test.R;

/**
 * Created by yjm on 2017/10/17.
 */
public class BaseToolbarTitle extends AppCompatActivity {
    public static ImageButton left_toolbar;
    public static TextView title_toolbar;
    public static TextView right_toolbar;
    public static Toolbar toolbar;
    public static ImageView nav_right_imge_button;

    /**
     * 设置标题栏
     **/
    public void setTitleContent(String title) {
        left_toolbar = (ImageButton) findViewById(R.id.nav_left_text);
        title_toolbar = (TextView) findViewById(R.id.center_title);
        right_toolbar = (TextView) findViewById(R.id.nav_right_text_button);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        nav_right_imge_button = (ImageView) findViewById(R.id.nav_right_imge_button);
        title_toolbar.setText(title);

        left_toolbar.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

}
